import { GETWEEKRANK, GETHISTORYRANK } from "../action/actionType";
import { GETMONTHRANK } from './../action/actionType';

export let rank = (state = {
    weekRankData: null,
    monthRankData: null,
    historyRankData: null,
}, action) => {
    let {
        type
    } = action;
    let newState = {
        ...state
    };
    switch (type) {
        case GETWEEKRANK:
            newState.weekRankData = action.data;
            return newState
            break;
        case GETMONTHRANK:
            newState.monthRankData = action.data;
            return newState
            break;
        case GETHISTORYRANK:
            newState.historyRankData = action.data;
            return newState
            break;
        default:
            return newState
            break;
    }
}